package cn.kgc.flightdemo01.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;

@CrossOrigin(origins = "http://localhost:8081")
@RestController
public class testController {

    @GetMapping("/test01")
    public Map<String, Object> testCors(HttpServletRequest request) {
        Map<String, Object> map = new HashMap<>();
        map.put("msg", "测试成功");
        return map;
    }

}